package test.java.enumeration;

import java.util.ArrayList;
import java.util.List;

public enum Land_Enums {
  America ("USA"),
  China ("Zhong guo"),
  Germany ("Deutschland"),
  Russia ("Russland");

  private String                  landName;
  private static List<Land_Enums> landList = new ArrayList<Land_Enums> ();

  public String getLandName () {
    return landName;
  }

  private static void initLandList () {
    landList = new ArrayList<Land_Enums> ();
    for (Land_Enums e: Land_Enums.values ()) {
      landList.add (e);
    }
  }

  private Land_Enums (String name) {
    this.landName = name;
  }

  public String value () {
    return name ();
  }

  public static Land_Enums fromValue (String value) {
    return valueOf (value);
  }

  public static void showAll () {
    System.out.println ("Show all items");
    for (Land_Enums e: Land_Enums.values ()) {
      System.out.println ("Land.value : " + e.value ());
      System.out.println ("Land.landname : " + e.getLandName ());
    }
  }

  public boolean isOneOFEnums (String landname) {
    return landList.contains (valueOf (landname));
  }

}
